package com.yochi.pictureseditor.tools;

import java.io.File;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class ShareUtils {
	
	public static Intent buildShareIntentFromPath(Context context, String picturePath) {
		if(picturePath == null) {
			return null;
		}
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("image/png");
        Uri uri = Uri.fromFile(new File(picturePath));
        intent.putExtra(Intent.EXTRA_STREAM, uri);
        return intent;
	}
	
	public static void shareImageFromPath(Context context, String picturePath) {
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("image/png");
        Uri uri = Uri.fromFile(new File(picturePath));
        intent.putExtra(Intent.EXTRA_STREAM, uri);
        context.startActivity(Intent.createChooser(intent, "Share"));
	}

}
